package com.chris.libs.example.pages.ext.swiperefresh;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.chris.libs.example.model.DataItem;

import java.util.List;

/**
 * @author Chris Chan
 * Create on: 2025-09-12 15:25
 * Use for: SwipeRefresh 数据中心
 * Explain:
 */
public class SwipeRefreshViewModel extends ViewModel {
    // 示例数据
    private MutableLiveData<String> info;
    private MutableLiveData<List<DataItem>> dataList;

    // 构造方法
    public SwipeRefreshViewModel() {
        info = new MutableLiveData<>();
        dataList = new MutableLiveData<>();
        setInfo("测试");
    }

    // 示例数据读取
    public MutableLiveData<String> getInfo() {
        return info;
    }

    // 示例数据赋值
    public void setInfo(String info) {
        this.info.setValue(info);
    }

    public MutableLiveData<List<DataItem>> getDataList() {
        return dataList;
    }

    public void setDataList(List<DataItem> dataList) {
        this.dataList.setValue(dataList);
    }
}
